package com.banciyuan.bcywebview.biz.setting;


import android.content.Context;

import java.util.ArrayList;
import java.util.List;

import de.greenrobot.daoexample.model.Province;

public class CommonSelectCityBuilder extends SelectCityDialog.Builder {
    public CommonSelectCityBuilder(Context context) {
        super(context);
    }

    @Override
    protected void changeCity() {
        mydialog.dismiss();
        if (null != changeCityListener) {
            changeCityListener.onCityChanged(newCityName, provinceNum, cityNum);
        }
    }

    @Override
    protected void popIllegalData() {
        List<Province> illegalData = new ArrayList<>();
        for (int i = 0; i < list.size(); i++) {
            Province province = list.get(i);
            String code = province.getCode();
            if ("3261".equals(code) || "3297".equals(code) || "3298".equals(code) || "3299".equals(code) || "3300".equals(code)) {
                illegalData.add(province);
            }
        }
        list.removeAll(illegalData);
    }
}
